package xyz.qduwo.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "Journal", schema = "dbo", catalog = "streamboard")
public class JournalEntity {
    private int id;
    private int creator;
    private String content;
    private Integer canvas;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "creator")
    public int getCreator() {
        return creator;
    }

    public void setCreator(int creator) {
        this.creator = creator;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "canvas")
    public Integer getCanvas() {
        return canvas;
    }

    public void setCanvas(Integer canvas) {
        this.canvas = canvas;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JournalEntity that = (JournalEntity) o;
        return id == that.id &&
                creator == that.creator &&
                Objects.equals(content, that.content) &&
                Objects.equals(canvas, that.canvas);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, creator, content, canvas);
    }
}
